package com.tuanzhang.mall.goods.domain.valueobj;

import com.tuanzhang.mall.seller.types.exception.ApiException;
import lombok.Getter;

/**
 * 类功能描述
 *
 * @author wangyl
 * @date 2025/6/17
 */
@Getter
public class SpuCode {

    private Long spuCode;

    private SpuCode() {
    }

    private SpuCode(Long spuCode) {
        if (null == spuCode) {
            throw new ApiException("商品编号不能为空");
        }
        this.spuCode = spuCode;
    }

    public static SpuCode getSpuCode(Long spuCode) {
        return new SpuCode(spuCode);
    }
}
